<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h2 v-text="massage+'!'">成都</h2>
        <h4 v-text="info+'!'">成都</h4>
        <h3>{{massage +'!'}}成都</h3>

        <!--v-text与v-html区别
            text单纯文本渲染
            html需要解析html的结构-->
        <p v-text="content"></p>
        <p v-html="content"></p>

        <input type="button" value="v-on指令" v-on:click="doIt">
        <input type="button" value="v-on简写" @click="doIt">
        <input type="button" value="双击事件" @dblclick="doIt">
        <h2 @click="changfood ">{{food}}</h2>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                food: "西兰花炒蛋",
                massage: "Berlin",
                info: "Web_Vue开发",
                content: "<a href='https://www.bilibili.com/'>v-html</a>"
            },
            methods: {
                doIt() {
                    alert("vue-on");
                },
                changfood() {
                    console.log(this.food)
                    this.food += "好好吃"
                }
            }
        })
    </script>
</body>

</html>